

var promise = new Promise((resolve,reject)=>{
    setTimeout(() => {
        resolve("hello,promise~")
        reject("bad promise!")
    }, 2000);
})

promise.then(function(data){
    console.log(data)
}).catch(function(err){
    console.log(err)
})